package com.fone.player.util;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;

public class SharedPreferenceOnline {
	
	private SharedPreferences sp;
	
	public SharedPreferenceOnline(Context context, String name) {
		super();
		sp = context.getSharedPreferences(name, Context.MODE_PRIVATE);
	}
	
	public Long getTime(){
		return sp.getLong("time", 0L);
	}
	
	public String getData(){
		return sp.getString("data", "");
	}
	
	public void setTime(Long time){
		Editor editor = sp.edit();
		editor.putLong("time", time);
		editor.commit();
	}
	
	public void setData(String data){
		Editor editor = sp.edit();
		editor.putString("data", data);
		editor.commit();
	}
	
	public void setAll(Long time, String data){
		Editor editor = sp.edit();
		editor.putLong("time", time);
		editor.putString("data", data);
		editor.commit();
	}

}
